import { handle } from '../../index'

const suffix = 'api'

// 查询所有分类
export const sysLabelGetAllSysLabels = () => handle({
  url: `/${suffix}/sys/label/getAllSysLabels`,
  method: 'get',
})
// 新增标签
export const sysLabelSave = (params: any) => handle({
  url: `/${suffix}/sys/label/save`,
  method: 'post',
  params
})
// 编辑标签
export const sysLabelUpdate = (params: any) => handle({
  url: `/${suffix}/sys/label/update`,
  method: 'post',
  params
})
// 删除标签
export const sysLabelDelete = (id: any) => handle({
  url: `/${suffix}/sys/label/delete/${id}`,
  method: 'get',
})
// 查询详情
export const sysLabelDetail = (id: any) => handle({
  url: `/${suffix}/sys/label/detail/${id}`,
  method: 'get',
})
// 查询所有索引
export const sysLabelGetAllIndexsByKey = (params: any) => handle({
  url: `/${suffix}/sys/label/getAllIndexsByKey`,
  method: 'get',
  params
})
// 查询所有标签关联索引
export const sysLabelGetAllSysLabelTypes = (id: any) => handle({
  url: `/${suffix}/sys/label/getAllSysLabelTypes/${id}`,
  method: 'get',
})
// 新增索引到指定分类下
export const sysLabelAddIndexToLabel = (params: any) => handle({
  url: `/${suffix}/sys/label/addIndexToLabel`,
  method: 'get',
  params
})
// 新增索引到指定分类下
export const sysLabelDeleteLink = (id: any) => handle({
  url: `/${suffix}/sys/label/deleteLink/${id}`,
  method: 'get',
})
